package com.wenyu.wenyuyuedu.mytestdemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.wenyu.wenyuyuedu.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

public class MyHorizontalDemo extends AppCompatActivity {

    @InjectView(R.id.recycler_view)
    RecyclerView mRecyclerView;
    private List<Integer> mlist;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_horizontal_demo);
        ButterKnife.inject(this);
        mlist = new ArrayList<>();
        mlist.add(R.drawable.wenyulogo);
        mlist.add(R.drawable.login_logo);
        mlist.add(R.drawable.nomal_dynamic);
        mlist.add(R.drawable.wenyulogo);
        mlist.add(R.drawable.login_logo);
        mlist.add(R.drawable.nomal_dynamic);
        mlist.add(R.drawable.wenyulogo);
        mlist.add(R.drawable.login_logo);
        mlist.add(R.drawable.nomal_dynamic);
        mlist.add(R.drawable.wenyulogo);
        mlist.add(R.drawable.login_logo);
        mlist.add(R.drawable.nomal_dynamic);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        mRecyclerView.setLayoutManager(linearLayoutManager);
        MyHorizontalAdapter myHorizontalAdapter = new MyHorizontalAdapter(MyHorizontalDemo.this, mlist);
        mRecyclerView.setAdapter(myHorizontalAdapter);
    }
}
